package com.jeasonzhao.commons.logger;

import java.util.Date;

public class LogBean
{
    private String message = null;
    private LogLevel errorLevel = LogLevel.DEBUG;
    private Throwable exception = null;
    private java.util.Date date = new java.util.Date();
    public LogBean()
    {
        super();
    }

    public LogBean(LogLevel level,String msg,Throwable e)
    {
        super();
        this.message = msg;
        this.errorLevel = level;
        this.exception = e;
    }

    public String toString()
    {
        return MessageBasedLogListener.formatMessage(this.errorLevel,null,this.message,this.exception);
    }

    public Date getDate()
    {
        return date;
    }

    public LogLevel getErrorLevel()
    {
        return errorLevel;
    }

    public Throwable getException()
    {
        return exception;
    }

    public String getMessage()
    {
        return message;
    }

    public void setMessage(String message)
    {
        this.message = message;
    }

    public void setException(Throwable exception)
    {
        this.exception = exception;
    }

    public void setErrorLevel(LogLevel errorLevel)
    {
        this.errorLevel = errorLevel;
    }

    public void setDate(Date date)
    {
        this.date = date;
    }

    public int hashCode()
    {
        return super.hashCode();
    }
}
